//万昱柔 2025/3/10
cc.Class({
    extends: cc.Component,

    properties: {
        pipe_down: cc.Node,
        pipe_up: cc.Node,
        maxHeight: 0,
        minHeight: 0,
        maxDic: 0,
        minDic: 0,
    },


    // onLoad () {},

    start() {
        //随机高度
        const height = Math.random() * (this.maxHeight - this.minHeight) + this.minHeight;
        //随机间隔
        const dic = Math.random() * (this.maxDic - this.minDic) + this.minDic;

        //随机钢管的高度
        this.pipe_up.y += height;
        //绑定上下钢管的间距
        this.pipe_down.y = this.pipe_up.y + dic;

    },
    move() {
        //tween缓动系统
        cc.tween(this.node)
            .to(2, { position: cc.v2(-200, 0) })
            .removeSelf()
            .start()
    }

    // update (dt) {},
});
